!!!
%html                                                                
  %head
    %script{:type=>"text/javascript", :src=>"/javascript/jquery.js"}
    %script{:type=>"text/javascript", :src=>"/javascript/jquery-ui.js"}
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"blueprint/screen.css",:media=>"screen, projection"}
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"blueprint/print.css", :media=>"print" }
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"blueprint/plugins/buttons/screen.css", :media=>"screen" }
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"/css/downloader.css"}
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"/css/smoothness/jquery-ui-1.7.2.custom.css"}
    <!--[if lt IE 8]>
    %link{:rel=>"stylesheet", :type=>"text/css",:href=>"blueprint/ie.css" ,:media=>"screen, projection"}
    <![endif]-->
  %body
    .container
      .span-24
        %h1 Het Download Manager
      .span-24
        %a.button#addlinks{:href=>"#"} add links
        %a.button#status{:href=>"#"} status
        %a.button#options{:href=>"#"} options
      %hr/
      .span-24.hidden#addlinksform
        .span-24 Add Links:
        .span-24
          %form#formaddlinks{:action=>"#"}
            %textarea#linkstextarea{:name=>"links"}
        .span-24
          %a.button#add{:href=>"#"} add
      .span-24#main
      .span-24#debug
    :javascript
      function getstatus(){    
        $.ajax({
          type: "GET",
          url: "/status",
          success: function(html){
            $("#main").empty();
            $("#main").append(html);
          },
          error: function(html){
            $("#debug").empty();
            $("#debug").append(html);
          }
        });    
      }
      $(document).ready(function() {
        getstatus();
        $("#status").click(function(){getstatus()});
        
        $("#addlinks").click(function(){
          $("#linkstextarea").val('');
          $("#addlinksform").toggle();
        });
        
        $("#add").click(function(){
          $.ajax({
            type: "POST",
            url: "/add",
            data: $("#formaddlinks").serialize(),
            success: function(){
              $("#addlinksform").hide();
              setTimeout( "getstatus();", 3*1000 );          
            }
          });
        });
        $("#options").click(function(){
          clearTimeout ( tmo );
          $.ajax({
            type: "GET",
            url: "/options",
            success: function(html){
              $("#main").empty();
              $("#main").append(html);
            },
            error: function(html){
              $("#debug").empty();
              $("#debug").append(html);
            }
          });
        });
      });